<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "{{%user_order}}".
 *
 * @property int $id
 * @property string $order_sn
 * @property int $user_id
 * @property int $coupon_id
 * @property int $create_time
 * @property int $pay_status 支付状态;0:未支付；1：已支付
 * @property int $pay_time 支付时间
 */
class UserOrderModel extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return '{{%user_order}}';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['order_sn', 'user_id', 'coupon_id', 'create_time'], 'required'],
            [['user_id', 'coupon_id', 'create_time', 'pay_status', 'pay_time','pay_status', 'pay_time'], 'integer'],
            [['order_sn'], 'string', 'max' => 32],

        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'order_sn' => 'Order Sn',
            'user_id' => 'User ID',
            'coupon_id' => 'Coupon ID',
            'create_time' => 'Create Time',
            'code' => '兑换码',
            'pay_status' => '支付状态;0:未支付；1：已支付',
            'pay_time' => '支付时间',
        ];
    }
}
